package com.qs.response;

/**
 * ClassName: ResponseEnum
 * Package: com.sixkey.response
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2023/9/27 - 17:07
 * @Version: v1.0
 */

import lombok.Getter;

/**
 * 响应码
 */
@Getter
public enum ResponseEnum {

    //客户端错误
    BAD_REQUEST(400,"请求错误！"),
    UNAUTHORIZED(401,"身份信息不合法"),
    FORBIDDEN(403,"无权限，请重新登录"),
    NOT_FOUND(404,"请求资源不存在"),

    //成功
    SUCCESS(200,"请求成功"),

    //业务代码
    SYSTEM_ERROR(500,"系统错误"),
    GOODS_DATA_NOT_FOUND(1001,"暂无热卖商品~"),
    TOKEN_EXPIRE(1002,"登录过期！"),
    GOODS_NOT_FOUND(1003,"商品不存在！"),
    GOODS_NUM_INSUFFICIENT(1004,"商品库存不足！"),
    PAY_FOR_FAIL(1005,"支付失败！"),
    CODE_EXPIRE(1006,"验证码已过期！"),
    CODE_ERROR(1008,"验证码错误！"),
    USER_NOT_EXITS(1010, "用户不存在"),
    USER_FORBID(1011, "用户已被禁用"),
    USER_EXITS(1012, "用户昵称已存在"),
    PASSWORD_ERROR(1013, "密码错误！"),
    ADDRESS_ERROR(1014, "默认地址已存在！"),
    ADDRESS_NOT_FOUND(1015, "地址不存在！"),
    HAVE_COLLECTED(1016, "已收藏过！"),
    HAVE_COLLECTED_STORE(1018, "已订阅过！");


    /**
     * 响应返回码
     */
    private final Integer code;
    /**
     * 响应返回消息
     */
    private final String message;

    ResponseEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
